<SCRIPT type="text/javascript">
	var setting = {
		check: {
				enable: true,
				chkStyle: "radio",
				radioType: "all"
			},
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
			//onCollapse: alert("up"),
			onExpand: function(){
				if (treeNiceScroll) {
					treeNiceScroll.resize();
				}
			}
		},
		view: {
			showLine: false
		}
	};
	var zNodes1 =[
		{ id:"0", pId:0, name:"文件夹", open:true,nocheck:true,icon:"/assets/images/icon-file-closed.png"},
		<#if tabid=='pub'>{ id:"public", pId:"0", name:"公共文件夹", tabtype:"pub", open:false, icon:"/assets/images/icon-file-closed.png"},</#if>
		{ id:"private", pId:"0", name:"个人文件夹",tabtype:"pri", open:false, icon:"/assets/images/icon-file-closed.png"}
		<#if dicList??>
		<#list dicList as dic>
			<#if tabid=='pub'>
				,{ id:"${dic.id!''}", pId:"<#if dic.tabtype=='pub'&&dic.parentid=='0'>public<#elseif dic.tabtype=='pri'&&dic.parentid=='0'>private<#else>${dic.parentid!''}</#if>", name:"${dic.name!''}",tabtype:"${dic.tabtype!''}", icon:"/assets/images/icon-file-closed.png"}
			<#else>
				<#if dic.tabtype=='pri'>
				,{ id:"${dic.id!''}", pId:"<#if dic.tabtype=='pub'&&dic.parentid=='0'>public<#elseif dic.tabtype=='pri'&&dic.parentid=='0'>private<#else>${dic.parentid!''}</#if>", name:"${dic.name!''}",tabtype:"${dic.tabtype!''}", icon:"/assets/images/icon-file-closed.png"}
				</#if>
			</#if>
		
		</#list>
		</#if>
	];
	

	$(document).ready(function(){
		var ztree = $.fn.zTree.init($(document.getElementById("zTree_report_dic_LIst")), setting, zNodes1);
		//页面初始化数据，选中默认的群组，并查询出该群组下的用户
		ztree.selectNode(ztree.getNodeByParam("id", "0", null));
		
		
	});
	function submitForm(){
		var treeObj = $.fn.zTree.getZTreeObj("zTree_report_dic_LIst");
		var nodes = treeObj.getCheckedNodes(true);
		if(nodes.length>0){
			var node = nodes[0];
			var id = node.id;
			if(id=="private"||id=="public"){
				id="0"
			}
			$("#dicid").val(id);
			$("#tabtype").val(node.tabtype);
			$("#shortcutForm").submit();
		}else{
			alertMsg("请选择目标文件夹！");
		}
	}
</SCRIPT>
<div class="artCon"  style="width: 320px">
	<div class="middleArt" style="width: 320px">
	<form class="form-horizontal" id="shortcutForm" action="/${orgi}/user/report/${tabid}/shortcutaddo.html" method="post">
	<input type="hidden" name="tabtype" id="tabtype" value=""/>
	<input type="hidden" name="targetReportid" id="targetReportid" value="${reportid!''}"/>
	<input type="hidden" name="dicid" id="dicid" value=""/>
		<div class="artMain">
			<div class="mainCenter">
				<div class="dialogWrapper_0313">
					<table class="spliptHalf_0313">
						<tr>
							<td class="spwrap">
								<div class="lftTreeWrap setScroll">
									<div class="ztree" id="zTree_report_dic_LIst"></div>
								</div>
							</td>
							
						</tr>
					</table>
				</div>
			</div>
		</div>
		<div class="bottomBg">
			<div class="btnWrap">
				<a href="javascript:void(0)" onclick="submitForm();" class="btnStyle1">确认</a>
				<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
			</div>
		</div>
		</form>
	</div>
</div>
